package com.example.cardemo.bean

import android.os.Parcel
import android.os.Parcelable

class ModellistBean {
    var reason: String? = null
    var result: List<ResultBean>? = null
    var error_code: Int? = null

    class ResultBean(
        val id: String?,
        val name: String?,
        val peizhi: String?,
        val series_id: String?,
        val year: String?
    ) : Parcelable {
        constructor(parcel: Parcel) : this(
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString(),
            parcel.readString()
        )

        override fun writeToParcel(parcel: Parcel, flags: Int) {
            parcel.writeString(id)
            parcel.writeString(name)
            parcel.writeString(peizhi)
            parcel.writeString(series_id)
            parcel.writeString(year)
        }

        override fun describeContents(): Int {
            return 0
        }

        companion object CREATOR : Parcelable.Creator<ResultBean> {
            override fun createFromParcel(parcel: Parcel): ResultBean {
                return ResultBean(parcel)
            }

            override fun newArray(size: Int): Array<ResultBean?> {
                return arrayOfNulls(size)
            }
        }
    }
}